package test;

    enum Daylight {Morning, Noon, Evening, Night}//перечисление
    enum Luminary {IsShiny, IsntShiny}
    enum Baby {Puppy, Kitten, Hedgehog, Bearcub, Piglet, Bat, Balloon,Error}
    enum delivery {Demon, Stork}
public class Cloud {
    public Cloud (){};
    Daylight daylight;
    Luminary luminary;
    int win_val; // от 0 до 10
    Baby baby = Baby.Kitten;
    
    private Baby InternalCreate() // создание
    {
        if((win_val>=0)||(win_val<=10)){
        if((win_val>=0)&&(win_val<=1)&&(luminary==Luminary.IsShiny)&&(daylight==Daylight.Morning))
                baby = Baby.Kitten;
       
        if(((win_val<=3)&&(win_val>=2))&&(luminary==Luminary.IsShiny)&&((daylight==Daylight.Noon))||(daylight==Daylight.Evening))
                baby = Baby.Puppy;
        
        if(((win_val<=5)&&(win_val>=4))&&(luminary==Luminary.IsntShiny)&&(daylight==Daylight.Morning))
                baby = Baby.Balloon;
        
        if(((win_val<=7)&&(win_val>=6))&&(luminary==Luminary.IsntShiny)&&(daylight==Daylight.Morning))
                baby = Baby.Hedgehog;
        
        if(((win_val==8)&&(luminary==Luminary.IsntShiny))&&(daylight==Daylight.Evening))
                baby = Baby.Piglet;
        
        if((win_val==9)&&(luminary==Luminary.IsntShiny)&&((daylight==Daylight.Noon)||(daylight==Daylight.Evening)))
                baby = Baby.Bat;
        
        if(((win_val==10)&&(luminary==Luminary.IsntShiny))&&(daylight==Daylight.Night))
                baby = Baby.Bearcub;
        return baby;
    }
        return Baby.Error;
    }
    
      public delivery Create() {
		baby = InternalCreate();
                Magic magic = new Magic();
		if (baby == Baby.Bat || baby == Baby.Piglet|| baby == Baby.Bearcub || baby == Baby.Hedgehog) {
			return magic.CallDaemon();
		} else {
			return magic.CallStork();
		}
	}
       
}
